1. Field of the Invention
This invention relates in general to computer-implemented database systems, and, in particular, to multiple-stage evaluation of user-defined predicates.
2. Description of Related Art
Databases are computerized information storage and retrieval systems. A Relational Database Management System (RDBMS) is a database management system (DBMS) which uses relational techniques for storing and retrieving data. Relational databases are organized into tables which consist of rows and columns of data. The rows are formally called tuples or records. A database will typically have many tables and each table will typically have multiple tuples and multiple columns. The tables are typically stored on direct access storage devices (DASD), such as magnetic or optical disk drives for semi-permanent storage.
Many traditional business transaction processing is done using a RDBMS. Since the inclusion of RDBMSs in business, user-defined data types and user-defined functions have been brought into RDBMSs to enrich the data modeling and data processing power. User-defined data based on the user-defined data types may include audio, video, image, text, spatial data (e.g., shape, point, line, polygon, etc.), time series data, OLE documents, Java objects, C++ objects, etc.
In conventional systems, user-defined functions may be used within SQL statements. However, when a function is within an SQL statement, if a table has "n" records, then the function is executed "n" times, which is inefficient. Additionally, conventional systems cannot process user-defined functions within predicates of a SQL statement (e.g., within a WHERE clause).
Therefore, there is a need in the art for improved evaluation of user-defined predicates.